<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Globalvar{
	private $propForm;
	private $propInput;
	private $propTextarea;
	private $propLabel;
	private $propTabla;
	private $propDiv;
	private $propContenedor;
	private $propUrlr;
	
	function Globalvar(){
		$this->propForm=array();
		$this->propInput=array();
		$this->propTabla=array();
		$this->propTextarea=array();
		$this->propLabel=array();
		$this->propDiv=array();
		$this->propContenedor=array();
		$this->propUrl=array();
		
		///////////////Inicializacion de arreglos
		$this->iniPropForm();
		$this->iniPropInput();
		
		/////////////Valores por defecto
		$this->defaultPropForm();
		$this->defaultPropInput();
		
		
		}

	function iniPropForm(){
		$this->propForm(array(	'tamanho'	=>NULL,
								'id'		=>NULL,
								'name'		=>NULL,
								'action'	=>NULL,
								'method'	=>NULL,
								'enctype'	=>NULL,
								'accept'	=>NULL,
								'onSubmit'	=>NULL,
								'onReset'	=>NULL,
								'class'		=>NULL
								
								
								));
		
		}
		function iniPropContenedor(){
			$this->propContenedor(array(	'tamanho'		=>NULL,
											'nameTabla'		=>NULL,
											'botones'		=>NULL,
											'tituloHtml'	=>NULL
		
			));
		
		}
		
		
	function iniPropInput(){
		############################################################
		//type,class,style,name,id,value,size,readOnly,disabled,onfocus,onblur,onselect,onchange,onClick,ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,onkeypress,onkeydown,onkeyup,data-placeholder,tabindex,data-size
		############################################################
		
		$this->propInput(array(	'type'			=>NULL,
								'class'			=>NULL,
								'style'			=>NULL,
								'name'			=>NULL,
								'id'			=>NULL,
								'value'			=>NULL,
								'size'			=>NULL,
								'readOnly'		=>NULL,
								'disabled'		=>NULL,
								'onFocus'		=>NULL,
								'onBlur'		=>NULL,
								'onSelect'		=>NULL,
								'onChange'		=>NULL,
								'onClick'		=>NULL,
								'onDblClick'	=>NULL,
								'onMouseDown'	=>NULL,
								'onMouseUp'		=>NULL,
								'onMouseOver'	=>NULL,
								'onMouseMove'	=>NULL,
								'onMouseOut'	=>NULL,
								'onKeyPress'	=>NULL,
								'onKeyDown'		=>NULL,
								'onKeyUp'		=>NULL,
								'dataPlaceHolder'	=>NULL,
								'tabIndex'		=>NULL,
								'dataSize'		=>NULL
								));
		}
	function iniPropTextarea(){
		############################################################
		//type,class,style,name,id,title,lang,dir,cols,rows,size,readOnly,disabled,tabindex,accesskey,onfocus,onblur,onselect,onchange,onclick,ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,onkeypress,onkeydown,onkeyup
		############################################################
		
		$this->propTextarea(array(	'type'			=>NULL,
								'class'			=>NULL,
								'style'			=>NULL,
								'name'			=>NULL,
								'id'			=>NULL,
								'title'			=>NULL,
								'lang'			=>NULL,
								'dir'			=>NULL,
								'cols'			=>NULL,
								'rows'			=>NULL,
								'size'			=>NULL,
								'readOnly'		=>NULL,
								'disabled'		=>NULL,
								'tabIndex'		=>NULL,
								'accesskey'		=>NULL,
								'onFocus'		=>NULL,
								'onBlur'		=>NULL,
								'onSelect'		=>NULL,
								'onChange'		=>NULL,
								'onClick'		=>NULL,
								'onDblClick'	=>NULL,
								'onMouseDown'	=>NULL,
								'onMouseUp'		=>NULL,
								'onMouseOver'	=>NULL,
								'onMouseMove'	=>NULL,
								'onMouseOut'	=>NULL,
								'onKeyPress'	=>NULL,
								'onKeyDown'		=>NULL,
								'onKeyUp'		=>NULL
								));
		}
	
	function iniPropDiv(){
		############################################################
		//class,id,style,title,dir,lang,align,,onclick,ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,onkeypress,onkeydown,onkeyup
		############################################################
		
		$this->propDiv(array(	'class'			=>NULL,
								'id'			=>NULL,
								'style'			=>NULL,
								'title'			=>NULL,
								'dir'			=>NULL,
								'lang'			=>NULL,
								'align'			=>NULL,
								'onClick'		=>NULL,
								'onDblClick'	=>NULL,
								'onMouseDown'	=>NULL,
								'onMouseUp'		=>NULL,
								'onMouseOver'	=>NULL,
								'onMouseMove'	=>NULL,
								'onMouseOut'	=>NULL,
								'onKeyPress'	=>NULL,
								'onKeyDown'		=>NULL,
								'onKeyUp'		=>NULL
								));
		}
		
		function iniPropTabla(){
			
			$this->propTabla(array(	'lista'			=>NULL,
									'orden'			=>NULL,
									'url'			=>NULL,
									'flagEdit'		=>NULL,
									'flagDelete'	=>NULL,
									'flagView'		=>NULL,
									'flagColorbox'	=>NULL,
									'flagRestaurar'	=>NULL,
									'flagOther'		=>NULL
		
			));
		
		}
		
		function iniPropLabel(){
			############################################################
			//class
			############################################################
		
			$this->propLabel(array(	'class'			=>NULL	));
		}
		
		function iniPropUrl(){
			$this->propContenedor(array(	'view'		=>NULL,
											'edit'		=>NULL,
											'delete'	=>NULL,
											'tituloHtml'=>NULL
		
			));
		
		}
		
	function defaultPropForm(){
		$this->propForm['tamanho']=12;
		}
		
	function defaultPropInput(){
		
		$this->propInput['type']='text';
		$this->propInput['class']='form-control';
		
	}
	
	function defaultPropLabel(){
	
		$this->propLabel['class']='control-label col-lg-4';
	
	}
	
	function defaultPropDiv(){
	
		$this->propDiv['class']='form-group';
	
	}
		
	function getPropForm(){
		return $this->propForm;
		}
	function getPropInput(){
		return $this->propInput;
		}
	function getPropTabla(){
		return $this->propTabla;
		}
	function getPropDiv(){
		return $this->propDiv;
	}
	function getPropLabel(){
		return $this->propLabel;
	}	
		
############# Add value #############################	
	function addValue($array,$name,$valor){
		
			while ($nameKey = current($array)) {
				if ($nameKey == $name) {
					$array[$name]=$valor;
					return $array;
					break;
				}
				next($array);
			}
			return $array;
		}
		
		function addValueOfArray($array,$array2){
		
			while ($nameKey = current($array)) {
				if(isset($array2[$nameKey])){
					$array[$nameKey]=$valor;
					
				}
				
				next($array);
			}
			return $array;
		}	

	
		
		
}

?>